package Menu;

import java.awt.BasicStroke;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.util.Iterator;

import javax.swing.*;



import formas.Dibujable;
import formas.Tablero;

public class Tablero2d extends Tablero{
     
	private final int FACTOR=10;
     
	 public Tablero2d(int ancho	,int largo) 
	   {
		 super(ancho,largo);
	   }
	 
	 public void dibujar(){
		 JFrame frame = new JFrame("A Basic Frame");
	   frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
	   frame.setSize( 425, 460 );
	   frame.setVisible( true );
	   Graphics graphics = frame.getGraphics();
	   frame.paint(graphics);
	   //System.out.println("iicial"+puntoInicial().getCordenadaX());
	   //graphics.drawRect(puntoInicial().getCordenadaX(), puntoInicial().getCordenadaY(), getAltura()*FACTOR, getBase()*FACTOR);//draw(r);

	   Iterator<Dibujable> iterator = this.getDibujos().iterator();
	   while (iterator.hasNext()) {
		   Dibujable d = iterator.next();
		   graphics.drawRect(d.puntoInicial().getCordenadaX(), d.puntoInicial().getCordenadaY(),getAltura()*FACTOR, getBase()*FACTOR);//draw(r);
System.out.println("entro");
	   }
	   
	   /*graphics.drawRect(10, 5, getAltura()*FACTOR, getBase()*FACTOR);//draw(r);
	   graphics.drawRect(50, 175, getAltura()*FACTOR, getBase()*FACTOR);//draw(r);
	 */
	  System.out.println();
	 
	 }
		 
	

}
